<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <title>供灯阁</title>
    <link type="text/css" rel="stylesheet" href="{MODULE_URL}public/deng/css/shelf.css">
    <script type="text/javascript" src="{MODULE_URL}public/deng/js/flexible.js"></script>
    <script type="text/javascript" src="{MODULE_URL}public/deng/js/pageLoading.js"></script>
</head>
<body>
<div class="shelf_bgbox">
    <div class="shelf_bg"><img src="{MODULE_URL}public/deng/images/bg_shelf.jpg" alt=""></div>
    <div class="shelf_lampbox" id="lamp">
        <ul class="shelf_lamp1">
            <li>
                <a href="javascript:;">
                    <img src="{MODULE_URL}public/deng/images/icon_lamp1.png" alt="">
                    <p>已供<span id="timer">0</span>天</p>
                    <i>光明灯</i>
                </a>
            </li>
            <li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp10.png" alt="">
                <p>已供<span id="timer">1</span>天</p>
                <i>平安灯</i>
            </a>
        </li><li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp3.png" alt="">
                <p>已供<span id="timer">0</span>天</p>
                <i>健康灯</i>
            </a>
        </li>      </ul>

        <ul class="shelf_lamp2">
            <li>
                <a href="javascript:;">
                    <img src="{MODULE_URL}public/deng/images/icon_lamp2.png" alt="">
                    <p>已供<span id="timer">0</span>天</p>
                    <i>招财灯</i>
                </a>
            </li><li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp5.png" alt="">
                <p>已供<span id="timer">0</span>天</p>
                <i>学业灯</i>
            </a>
        </li><li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp4.png" alt="">
                <p>已供<span id="timer">0</span>天</p>
                <i>事业灯</i>
            </a>
        </li>      </ul>

        <ul class="shelf_lamp3">
            <li>
                <a href="javascript:;">
                    <img src="{MODULE_URL}public/deng/images/icon_lamp6.png" alt="">
                    <p>已供<span id="timer">0</span>天</p>
                    <i>姻缘灯</i>
                </a>
            </li><li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp8.png" alt="">
                <p>已供<span id="timer">0</span>天</p>
                <i>求子灯</i>
            </a>
        </li><li>
            <a href="javascript:;">
                <img src="{MODULE_URL}public/deng/images/icon_lamp9.png" alt="">
                <p>已供<span id="timer">0</span>天</p>
                <i>生辰灯</i>
            </a>
        </li>      </ul>

        <ul class="shelf_lamp4">
            <li>
                <a href="javascript:;">
                    <img src="{MODULE_URL}public/deng/images/icon_lamp7.png" alt="">
                    <p>已供<span id="timer">0</span>天</p>
                    <i>忏悔灯</i>
                </a>
            </li>
        </ul>
    </div>
</div>
<div class="activity_window_box" id="activity_window_box">
    <div class="activity_window">
        <div class="dialog">
            <!-- 弹窗 -->
            <div class="details_box">
                <!-- <br> -->
                <p>阿弥陀佛，您已供<span id="lamp_win">光明灯</span><span id="timer_win">3</span>天。<br>还望您坚持每日供灯。</p>
            </div>
            <input type="submit" value="好的" class="btn_submit" onclick="closeMessageDialog()">
            <div class="close_box"><a href="#close" onclick="closeMessageDialog()">X</a></div>
        </div>
    </div>
</div>
</div>
 {template 'baifocommon/nav'}
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript">
    var my_lamp = [
        "光明灯","平安灯","健康灯","招财灯","学业灯","事业灯","姻缘灯","求子灯","生辰灯","忏悔灯",              ];
    var win2 = document.getElementById('activity_window_box');
    var lamp_kind = document.getElementById("lamp").getElementsByTagName("a");
    var timer = document.getElementById("lamp").getElementsByTagName("span");
    var timer_win = document.getElementById("timer_win");
    var lamp_win = document.getElementById("lamp_win");
    function closeMessageDialog() {
        win2.style.display="none";
    }
    for(i=0;i<lamp_kind.length;i++){
        for(j=0;j<timer.length;j++){
            //灯一光明灯
            lamp_kind[0].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[0].innerHTML;
                lamp_win.innerHTML = my_lamp[0];
            }
            //灯二招财灯
            lamp_kind[1].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[1].innerHTML;
                lamp_win.innerHTML = my_lamp[1];
            }
            //灯三健康灯
            lamp_kind[2].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[2].innerHTML;
                lamp_win.innerHTML = my_lamp[2];
            }
            //灯四事业灯
            lamp_kind[3].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[3].innerHTML;
                lamp_win.innerHTML = my_lamp[3];
            }
            //灯五智慧灯
            lamp_kind[4].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[4].innerHTML;
                lamp_win.innerHTML = my_lamp[4];
            }
            //灯六姻缘灯
            lamp_kind[5].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[5].innerHTML;
                lamp_win.innerHTML = my_lamp[5];
            }
            //灯七忏悔灯
            lamp_kind[6].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[6].innerHTML;
                lamp_win.innerHTML = my_lamp[6];
            }
            //灯八求子灯
            lamp_kind[7].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[7].innerHTML;
                lamp_win.innerHTML = my_lamp[7];
            }
            //灯九生辰灯
            lamp_kind[8].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[8].innerHTML;
                lamp_win.innerHTML = my_lamp[8];
            }
            //灯十平安灯
            lamp_kind[9].onclick = function(){
                win2.style.display = "table";
                timer_win.innerHTML = timer[9].innerHTML;
                lamp_win.innerHTML = my_lamp[9];
            }

        }
    }$(function(){
        $(".nav>li").on('tap', function(e){
            e.stopPropagation();
            var index = $(this).index();
            $(this).addClass('on').siblings().removeClass('on');

        });
        $(".dropA").on('tap',function(){
            if (!$('.dropdown').hasClass('downOn')) {
                $('.dropdown').addClass('downOn');
            }else{
                $('.dropdown').removeClass('downOn');
            }
        })
        $(document).on('tap', function(e){
            var obj = e.target;
            if (!$(obj).is('.dropdown, .dropdown *')) {
                $('.dropdown').removeClass('downOn');
            }
        });
    });
</script>
</body>
</html>